// 用户类型
export interface User {
  id: string
  name: string
  avatar?: string
  mobile?: string
  email?: string
  position?: string
  department?: string
  departmentName?: string
  status?: number
  createTime?: string
  updateTime?: string
}

// 组织架构节点类型
export interface TreeNode {
  id: string
  label: string
  children?: TreeNode[]
  isLeaf?: boolean
  isExternal?: boolean
  [key: string]: any
}

// 组件Props类型
export interface PersonSelectorProps {
  modelValue: boolean
  title?: string
  width?: string
  multiple?: boolean
  showActions?: boolean
  disabled?: boolean
  defaultSelected?: User[]
}

// 组件事件类型
export interface PersonSelectorEmits {
  (e: 'update:modelValue', value: boolean): void
  (e: 'confirm', users: User[]): void
  (e: 'cancel'): void
  (e: 'close'): void
  (e: 'view-detail', user: User): void
}

// 搜索表单类型
export interface SearchForm {
  keyword: string
  mobile?: string
  email?: string
  status?: number
}

// 分页配置类型
export interface PaginationConfig {
  current: number
  pageSize: number
  total: number
  showSizeChanger?: boolean
  showQuickJumper?: boolean
  showTotal?: boolean
}

export interface ApiResponse<T = any> {
  code: number
  message: string
  result: T
}

export interface ApiPaginationResult<T = any> {
  rows: T[]
  total: number
  current: number
  pageSize: number
}
